/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 头部样式 */
header {
    background: linear-gradient(90deg, #2c3e50, #3498db);
    color: white;
    padding: 30px 0;
    text-align: center;
    border-bottom: 4px solid #1abc9c;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin-bottom: 15px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

nav ul {
    list-style: none;
}

nav ul li {
    display: inline;
    margin: 0 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    color: #1abc9c;
    transform: translateY(-2px);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #1abc9c;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* 主要内容样式 */
main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

section {
    background-color: white;
    padding: 40px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    font-size: 2rem;
    text-align: center;
}

section ul {
    padding-left: 20px;
    margin-top: 10px;
}

/* 功能列表样式 */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 5px solid #3498db;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-left-color: #1abc9c;
}

.feature-item h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.feature-item p {
    color: #555;
    font-size: 1.05rem;
}

/* 按钮样式 */
button {
    background: linear-gradient(90deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

button:hover {
    background: linear-gradient(90deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.05rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #e8491d;
}

/* 登录消息样式 */
#loginMessage.success,
#registerMessage.success,
#settingsMessage.success {
    color: green;
}

#loginMessage.error,
#registerMessage.error,
#settingsMessage.error {
    color: red;
}

/* 页脚样式 */
footer {
    background: linear-gradient(90deg, #2c3e50, #34495e);
    color: white;
    text-align: center;
    padding: 25px;
    margin-top: 40px;
    border-top: 4px solid #1abc9c;
}

/* 主页面样式 */
.logout-button {
    background-color: #e8491d;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 0;
}

.logout-button:hover {
    background-color: #d73a11;
}

.welcome-message {
    background-color: #e6f7ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #1890ff;
}

.dashboard-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 250px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8e8e8;
}

.stat-card h3 {
    color: #35424a;
    margin-bottom: 10px;
    font-size: 18px;
}

.profile-info {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8e8e8;
}

.profile-info p {
    margin-bottom: 10px;
    font-size: 16px;
}

.profile-info span {
    font-weight: bold;
    color: #35424a;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav ul li {
        margin-bottom: 10px;
        display: block;
    }
    
    section {
        padding: 20px;
    }
    
    .dashboard-stats {
        flex-direction: column;
    }
    
    .stat-card {
        width: 100%;
        margin-bottom: 15px;
        min-width: 100%;
    }
}

/* DeepSeek问答功能样式 */
#chatContainer {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

#chatHistory {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 15px;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.ai {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    word-wrap: break-word;
}

.chat-message.user .message-content {
    background-color: #35424a;
    color: white;
    border-bottom-right-radius: 5px;
}

.chat-message.ai .message-content {
    background-color: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 5px;
}

#chatInputContainer {
    display: flex;
    gap: 10px;
}

#questionInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

#questionInput:focus {
    outline: none;
    border-color: #e8491d;
}

#sendQuestionBtn {
    background-color: #35424a;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
}

#sendQuestionBtn:hover {
    background-color: #e8491d;
}

#chatMessage.success {
    color: #2ecc71;
}

#chatMessage.error {
    color: #e74c3c;
}

#chatMessage.info {
    color: #3498db;
}

/* 文件上传按钮样式 */
.file-upload-btn {
    background-color: #f0f2f5;
    color: #35424a;
    border: 1px solid #ddd;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.file-upload-btn:hover {
    background-color: #e8491d;
    color: white;
    border-color: #e8491d;
}

/* 文件消息样式 */
.file-message {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 70%;
}

.chat-message.user .file-message {
    background-color: #e6f7ff;
    border-color: #91d5ff;
}

.chat-message.ai .file-message {
    background-color: #f0f2f5;
    border-color: #d9d9d9;
}

.file-icon {
    font-size: 24px;
}

.file-name {
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #888;
    font-size: 12px;
}

.view-file-btn {
    background-color: #35424a;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-left: auto;
}

.view-file-btn:hover {
    background-color: #e8491d;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .file-message {
        max-width: 90%;
        flex-wrap: wrap;
    }
    
    .view-file-btn {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
}